package com.moon.service.impl;

import com.moon.pojo.Emp;
import com.moon.pojo.EmpQueryParam;
import com.moon.pojo.PageResult;
import com.moon.pojo.User;
import com.moon.service.DataJoinService;
import com.moon.service.EmpService;
import com.moon.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class DataJoinServiceImpl implements DataJoinService {


    @Autowired
    private EmpService empService;

    @Autowired
    private UserService userService;
    @Override
    public void joinData() {
        PageResult<Emp> page = empService.page(new EmpQueryParam());
        List<User> users = userService.getAll();

        log.info(page.toString());
        users.forEach(user ->log.info(user.toString()));

    }
}
